﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<nelech.Models.DBModel.ListZimer>" %>
<%@ Import Namespace="nelech.Views.Shared.Code" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
צימרים - נלך
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div id="left">
 <%Html.RenderAction("AdvertShowThree", "Advert", new { id = 7 });%>

 
</div>
<div id="main">
    <h2>צימרים</h2>
    <% if (Model.isEmpty)
       { %>
       <h3>לא נמצאו תוצאות תואמות</h3>
    <%} %>
 <div class="userForm">
            <% using (Html.BeginForm("SearchZimer", "Track"))
               { %>
            <fieldset>
                <legend>חיפוש צימר:</legend>
                
                <p>
                    <label for="area">
                        אזור:</label>
                    <%= Html.DropDownList("regeon", Utils.CreateRegeonListItems(21)) %>
                    <label for="size">
                       גודל:</label>
                    <%= Html.DropDownList("size", Utils.CreateSizeListItems(1), null, null) %>
                </p>
                 <p><label for="searchString">חיפוש חופשי:</label>
                <%= Html.TextBox("searchString") %></p>
              <p class="floatleft">
                <input type="submit" value="חפש" /></p>
            </fieldset>
            <%} %>
        </div>

  <%foreach (var item in Model.zimers)
       {%>
    <fieldset class="recommended">
        <legend>
            <%= Html.ActionLink(item.name, "ZimerInfo", new { id = item.id })%>
        </legend>
     <p class="floatright">
            <% if (item.Image.Count > 0)
               {
                   var images = item.Image.OrderBy(p => p.path);
                   var firstImage = images.First();
                   var smallImageName = System.IO.Path.GetFileName(firstImage.path.Replace("\\", "/"));
            %>
           <img  src="<%= "/Upload/Thumbs/" + smallImageName %>" alt="<%= firstImage.text %>" width="150px" />
            <% } %> </p>
<p>
        <p>
            <span class="bold">מפת סימון שבילים: </span>
            <% item.Regeon1Reference.Load(); %>
            <%= Html.Encode(item.Regeon1.id + " - " + item.Regeon1.text) %><br />
           
            <%if (item != null && item.Size != null)
              {%>
            <span class="bold">גודל הצימר:</span>
            <%    foreach (var size in item.Size)
                  {
                      Response.Write(size.text + ", ");
                  }
              }
            %>
           </p>
             <p><%= Html.ActionLink("להרחבה", "ZimerInfo" ,new { id = item.id })%></p>
    </fieldset>
    <% } %>
   
<%= Html.ActionLink("לרשימת כל הצימרים", "AllList", "Home", new {id = 4 },null)%>
  </div>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="publishTop" runat="server">
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="Right" runat="server">
 <%Html.RenderAction("AdvertShowThree", "Advert", new { id = 6 });%>
</asp:Content>

